home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / BOOT-DS.ASM < prev    next >
Assembly Source File  |  1986-02-05  |  3KB  |  116 lines

  1. ; Boot Record Program (C) Copyright Peter Norton 1986
  2. ; From PC Magazine ca. January 1986
  3.  
  4. boots segment 'code'
  5.  
  6.       public boot
  7.  
  8.       assume cs:boots
  9.  
  10. boot  proc   far
  11.  
  12. ;  30-byte DOS info -- set up for 2-sides, 9-sector
  13. ;  change as needed for any other format
  14.  
  15. head:
  16.       jmp    begin      ; EB 2A 90 as per normal
  17.       db     ' DE 1.0 ' ; 8-byte system id
  18.       dw     512        ; sector size in bytes
  19.       db     2          ; sectors per cluster
  20.       dw     1          ; reserved clusters
  21.       db     2          ; number of fats
  22.       dw     112        ; root directory entries
  23.       dw     760        ; total sectors
  24.       db     0FDh       ; format id
  25.       dw     2          ; sectors per fat
  26.       dw     9          ; sectors per track
  27.       dw     2          ; sides
  28.       dw     0          ; special hidden sectors
  29.  
  30. ; mysterious but apparently standard 14-byte filler
  31.       db     14 dup (0)
  32.  
  33. ; carry on with the boot work
  34.  
  35. begin:
  36.       mov    ax,07C0h   ; boot record location
  37.       push   ax
  38.       pop    ds
  39.       mov    bx,message_offset  ; put offset to message into si
  40.       mov    cx,message_length  ; message length from cx
  41. continue:
  42.       mov    ah,14      ; write teletype
  43.       mov    al,[bx]
  44.       push   ds
  45.       push   cx
  46.       push   bx
  47.       int    10h
  48.       pop    bx
  49.       pop    cx
  50.       pop    ds
  51.       inc    bx
  52.       loop   continue
  53.  
  54.       mov    ah,0       ; read next keyboard character
  55.       int    16h
  56.  
  57.       mov    ah,15      ; get video mode
  58.       int    10h
  59.       mov    ah,0       ; set video mode (clears screen)
  60.       int    10h
  61.  
  62.       int    19h        ; re-boot
  63.  
  64. beg_message:
  65.       db     0Dh,0Ah    ; carriage return, line-feed
  66.       db     0Dh,0Ah
  67.       db     0Dh,0Ah
  68.       db     0Dh,0Ah
  69.       db     '     Start your computer with'
  70.       db     0Dh,0Ah
  71.       db     '     a DOS system diskette.'
  72.       db     0Dh,0Ah
  73.       db     0Dh,0Ah
  74.       db     0Dh,0Ah
  75.       db     '     This is'
  76.       db     0Dh,0Ah
  77.       db     '        The Norton Utilities'
  78.       db     0Dh,0Ah
  79.       db     '            Version 3.0'
  80.       db     0Dh,0Ah
  81.       db     '     from'
  82.       db     0Dh,0Ah
  83.       db     '         Peter Norton'
  84.       db     0Dh,0Ah
  85.       db     '         2210 Wilshire Blvd'
  86.       db     0Dh,0Ah
  87.       db     '         Santa Monica, CA 90403'
  88.       db     0Dh,0Ah
  89.       db     0Dh,0Ah
  90.       db     '           (213) 826-8092'
  91.       db     0Dh,0Ah
  92.       db     0Dh,0Ah
  93.       db     0Dh,0Ah
  94.       db     0Dh,0Ah
  95.       db     '    Insert a DOS diskette'
  96.       db     0Dh,0Ah
  97.       db     '    Press any key to start DOS ... '
  98. end_message:
  99.  
  100. ; I put a copyright notice here; you do if you want to ...
  101. tail:
  102.  
  103. message_offset equ beg_message - head
  104. message_length equ end_message - beg_message
  105. filler_amount  equ 512 - (tail - head) - 2
  106.  
  107.       db     filler_amount dup (0)      ; filler
  108.  
  109.       db     055h,0AAh                  ; boot id
  110.  
  111. boot  endp
  112.  
  113. boots ends
  114.  
  115.       end
  116.